package com.tmy.controller;

import com.tmy.Dto.CommonDto;
import com.tmy.Dto.PageInfo;
import com.tmy.Dto.Result;
import com.tmy.entity.RoomInfo;
import com.tmy.entity.UserInfo;
import com.tmy.service.RoomInfoService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 房型管理接口
 */
@RestController
@RequestMapping("/roomInfo")
public class RoomInfoController {
    @Resource
    private RoomInfoService roomInfoService;

    /**
     *新增房型
     */
    @PostMapping("/addRoom")
    public Result addRoom(@RequestBody RoomInfo roomInfo){
        return roomInfoService.addRoom(roomInfo);
    }
    /**
     * 删除房型
     */
    @PostMapping("/deleteRoom")
    public Result deleteRoom(@RequestBody RoomInfo roomInfo){
        return roomInfoService.deleteRoom(roomInfo);
    }

    /**
     * 删除房型
     */
    @PostMapping("/deleteRooms")
    public Result deleteRooms(@RequestBody CommonDto commonDto){
        return roomInfoService.deleteRooms(commonDto);
    }

    /**
     * 更新房型
     */
    @PostMapping("/updateRoom")
    public Result updateRoom(@RequestBody RoomInfo roomInfo){
        return roomInfoService.updateRoom(roomInfo);
    }
    /**
     * 查询房型 分页查询
     */
    @PostMapping("/queryRoomPage")
    public Result queryRoomPage(@RequestBody PageInfo pageInfo){
        return roomInfoService.queryRoomPage(pageInfo);
    }


}
